#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    char shabichild[100];
    int ohmygod;
    int mydear;
    scanf("%d", &mydear);
    while (mydear--)
    {
        scanf("%s", shabichild);
        for (ohmygod = 0; shabichild[ohmygod] != '\0'; ohmygod++)
        {
            if ('A' <= shabichild[ohmygod] && shabichild[ohmygod] <= 'Z')
                printf("%c", shabichild[ohmygod] + 32);
            else
                printf("%c", shabichild[ohmygod]);
        }
        printf("\n");
    }

    return 0;
}